CMAKE_MINIMUM_REQUIRED( VERSION 2.8 )

PROJECT( client )

#SET(CMAKE_BUILD_TYPE RELEASE)
SET(CMAKE_BUILD_TYPE DEBUG)

SET( SRCS
  src/client.cpp
  src/main.cpp
)

SET( HEADERS
  src/client.h
)

FIND_PACKAGE( Qt4 COMPONENTS QtCore QtGui QtNetwork REQUIRED )
FIND_LIBRARY( SENSOR_LIBRARY sensor ${CMAKE_INSTALL_PREFIX}/lib )
FIND_LIBRARY( QDISPLAY_LIBRARY qdisplay ${CMAKE_INSTALL_PREFIX}/lib )
FIND_PACKAGE( OpenCV REQUIRED )

# TO CLEAN-UP 
#FIND_LIBRARY( URG_LIBRARY urg urg_monitor )
#FIND_PATH( URG_INCLUDES "urg/UrgCtrl.h" )
#SET( URG_INCLUDES `urg-config --cflags` )
#SET( URG_LIBRARY `urg-config --libs` )
SET( URG_LIBRARIES "-lurg_monitor -lurg -lurg_coordinate -lurg_geometry -lurg_connection -lurg_connection_sdl -lurg_common -lurg_system" )
SET( URG_INCLUDES "-I/usr/local/include" )

QT4_WRAP_CPP( HEADERS_MOC ${HEADERS} )

INCLUDE( ${QT_USE_FILE} )

INCLUDE_DIRECTORIES(
  ${QT_INCLUDES} 
  ${CMAKE_INSTALL_PREFIX}/include
  ${URG_INCLUDES}
  ${OpenCV_INCLUDE_DIRS}
)

ADD_EXECUTABLE( wifibot_client ${SRCS} ${HEADERS_MOC} )

TARGET_LINK_LIBRARIES( wifibot_client
  ${QT_LIBRARIES}
  ${SENSOR_LIBRARY}
  ${QDISPLAY_LIBRARY}  
  ${URG_LIBRARIES}
  ${OpenCV_LIBS}
)

